Optimal. Leaf size=53 \[ 2 x \sqrt{\frac{b}{x}-\frac{a}{x^2}}+2 \sqrt{a} \tan ^{-1}\left (\frac{\sqrt{a}}{x \sqrt{\frac{b}{x}-\frac{a}{x^2}}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0789457, antiderivative size = 53, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {1979, 2007, 2013, 620, 203} \[ 2 x \sqrt{\frac{b}{x}-\frac{a}{x^2}}+2 \sqrt{a} \tan ^{-1}\left (\frac{\sqrt{a}}{x \sqrt{\frac{b}{x}-\frac{a}{x^2}}}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1979
Rule 2007
Rule 2013
Rule 620
Rule 203
Rubi steps
\begin{align*} \int \sqrt{\frac{-a+b x}{x^2}} \, dx &=\int \sqrt{-\frac{a}{x^2}+\frac{b}{x}} \, dx\\ &=2 \sqrt{-\frac{a}{x^2}+\frac{b}{x}} x-a \int \frac{1}{\sqrt{-\frac{a}{x^2}+\frac{b}{x}} x^2} \, dx\\ &=2 \sqrt{-\frac{a}{x^2}+\frac{b}{x}} x+a \operatorname{Subst}\left (\int \frac{1}{\sqrt{b x-a x^2}} \, dx,x,\frac{1}{x}\right )\\ &=2 \sqrt{-\frac{a}{x^2}+\frac{b}{x}} x+(2 a) \operatorname{Subst}\left (\int \frac{1}{1+a x^2} \, dx,x,\frac{1}{\sqrt{-\frac{a}{x^2}+\frac{b}{x}} x}\right )\\ &=2 \sqrt{-\frac{a}{x^2}+\frac{b}{x}} x+2 \sqrt{a} \tan ^{-1}\left (\frac{\sqrt{a}}{\sqrt{-\frac{a}{x^2}+\frac{b}{x}} x}\right )\\ \end{align*}
Mathematica [A] time = 0.0295023, size = 66, normalized size = 1.25 \[ \frac{2 x \sqrt{\frac{b x-a}{x^2}} \left (\sqrt{b x-a}-\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{b x-a}}{\sqrt{a}}\right )\right )}{\sqrt{b x-a}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.01, size = 56, normalized size = 1.1 \begin{align*} -2\,{\frac{x}{\sqrt{bx-a}}\sqrt{{\frac{bx-a}{{x}^{2}}}} \left ( \sqrt{a}\arctan \left ({\frac{\sqrt{bx-a}}{\sqrt{a}}} \right ) -\sqrt{bx-a} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{\frac{b x - a}{x^{2}}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.857931, size = 228, normalized size = 4.3 \begin{align*} \left [2 \, x \sqrt{\frac{b x - a}{x^{2}}} + \sqrt{-a} \log \left (\frac{b x - 2 \, \sqrt{-a} x \sqrt{\frac{b x - a}{x^{2}}} - 2 \, a}{x}\right ), 2 \, x \sqrt{\frac{b x - a}{x^{2}}} - 2 \, \sqrt{a} \arctan \left (\frac{x \sqrt{\frac{b x - a}{x^{2}}}}{\sqrt{a}}\right )\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{\frac{- a + b x}{x^{2}}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.28611, size = 82, normalized size = 1.55 \begin{align*} -2 \,{\left (\sqrt{a} \arctan \left (\frac{\sqrt{b x - a}}{\sqrt{a}}\right ) - \sqrt{b x - a}\right )} \mathrm{sgn}\left (x\right ) + 2 \,{\left (\sqrt{a} \arctan \left (\frac{\sqrt{-a}}{\sqrt{a}}\right ) - \sqrt{-a}\right )} \mathrm{sgn}\left (x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]